import request from "@/utils/request";
import { AxiosPromise } from "axios";
import { WarehouseQuery, WarehousePageVO, WarehouseType } from "./types";

/**
 * 仓库类型下拉列表
 */
export function getWarehouseType() {
  return request({
    url: "/Warehouse/ShowWarehouseType",
    method: "get",
  });
}

/**
 * 仓库分页
 */
export function getWarehouse(params: PageQuery) {
  return request({
    url: "/Warehouse/ShowWarehouse",
    method: "get",
    params,
  });
}

// 添加仓库
export function AddWarehouse(data: any) {
  return request({
    url: "/Warehouse/AddWarehouse",
    method: "post",
    data: data,
  });
}

// 删除仓库
export function DelWarehouse(data: any) {
  return request({
    url: "/Warehouse/DelWarehouse?id=" + data,
    method: "delete",
  });
}

// 反填仓库
export function BackFillWarehouse(data: any) {
  return request({
    url: "/Warehouse/BackFillWarehouse?id=" + data,
    method: "get",
  });
}

// 修改仓库
export function UpdWarehouse(data: any) {
  return request({
    url: "/Warehouse/UpdWarehouse",
    method: "put",
    data: data,
  });
}
